<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="认领列表" libs=["table"]/>
<div class="container-div" id="_app">
    <!--<div class="row">-->
        <!--<div class="col-sm-12 search-collapse">-->
            <!--<@f.form id="module-form">-->
            <!--<div class="select-list">-->
                <!--<ul>-->
                    <!--<li class="select-time">-->
                        <!--<label>操作时间： </label>-->
                        <!--<@f.input id="startTime" name="beginTime"/>-->
                        <!--<span>-</span>-->
                        <!--<@f.input name="endTime"/>-->
                    <!--</li>-->
                    <!--&lt;!&ndash;<li>&ndash;&gt;-->
                    <!--&lt;!&ndash;<@ctx.i18n text = "认领状态"/>：&ndash;&gt;-->
                    <!--&lt;!&ndash;<@f.select name="claimStatus" dictType="claim_status" blankValue="" blankLabel="所有"/>&ndash;&gt;-->
                    <!--&lt;!&ndash;</li>&ndash;&gt;-->
                    <!--&lt;!&ndash;<li>&ndash;&gt;-->
                    <!--&lt;!&ndash;<@ctx.i18n text = "到账金额"/>：&ndash;&gt;-->
                    <!--&lt;!&ndash;<input type="text" class="form-control" name="arrivalAmount"/>&ndash;&gt;-->
                    <!--&lt;!&ndash;</li>&ndash;&gt;-->
                    <!--<li >-->
                        <!--<label>到账金额： </label>-->
                        <!--<@f.input id="arrivalAmount" name="arrivalAmount"/>-->
                        <!--<span>-</span>-->
                        <!--<@f.input name="arrivalAmount1"/>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<@ctx.i18n text = "汇款单位"/>：-->
                        <!--<input type="text" class="form-control" name="remittanceUnit"/>-->
                    <!--</li>-->

                    <!--<li>-->
                        <!--<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>  <@ctx.i18n text = "查询"/></a>-->
                        <!--<a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i> <@ctx.i18n text = "重置"/></a>-->
                    <!--</li>-->
                <!--</ul>-->
            <!--</div>-->
        <!--</@f.form>-->
    <!--</div>-->
    <@table id="bootstrap-table">

    <@shiro.hasPermission name="bpm:archice:add">
    <a class="btn btn-success" onclick="opt.operate.add(0)">
        <i class="fa fa-plus"></i> <@ctx.i18n text = "新增"/>
    </a>
</@shiro.hasPermission>
<@shiro.hasPermission name="bpm:archice:edit">
<a class="btn btn-primary" onclick="opt.operate.edit()">
    <i class="fa fa-edit"></i> <@ctx.i18n text = "修改"/>
</a>
</@shiro.hasPermission>
<@shiro.hasPermission name="bpm:archice:del">
<a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">
    <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>
</a>
</@shiro.hasPermission>

</@table>
    </div>
</div>
<@footer>
<script type="text/javascript">
    var statusDatas = ${dict.getDictListJson('claim_status')};
    var editFlag = "${permission.hasPermi("bpm:manager:form")}";
    var listFlag = "${permission.hasPermi("bpm:manager:add")}";
    // var categoryDatas = ${dict.getDictListJson('sys_bpm_category')};
    var prefix = baseURL + "bpm/manager";

    $(function() {
        var options = {
            url: prefix + "/list",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            clickToSelect: true,
            sortName: "id",
            delUrl: prefix + "/del",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",//认领箱
            uniqueId: 'id' , /* 唯一ID */
            modalName: "项目经理",
            columns: [
                // {field: 'selectItem', radio: true},
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                    return $.table.serialNumber(index);}},
                // {field : 'id',title : '<@ctx.i18n text = "编号"/>'},
                {field : 'name',title : '<@ctx.i18n text = "姓名"/>'},
                {field : 'username',title : '<@ctx.i18n text = "登录名"/>'},
                {field : 'userType',title : '<@ctx.i18n text = "类别"/>'},
                {field : 'mobile',title : '<@ctx.i18n text = "联系方式"/>'},
                {field : 'weiXin',title : '<@ctx.i18n text = "微信QQ"/>'},
                {field : 'introduce',title : '<@ctx.i18n text = "介绍人"/>'},
                {field : 'cardId',title : '<@ctx.i18n text = "卡号"/>'},
                {field : 'bank',title : '<@ctx.i18n text = "开户行"/>'},
                {field : 'remark',title : '<@ctx.i18n text = "备注"/>'}
           //     {field : 'id',title : ''},

                // {title:"<@ctx.i18n text = "操作"/>",align: 'left',class:'action',formatter: function(value, row, index) {
                //         var actions = [];
                //         // actions.push('<a class="" href="javascript:void(0)" title="<@ctx.i18n text = "关联流程表单"/>" onclick="taskFrom(\'' + row.id + '\')"><i class="fa icon-organization"></i></a> ');
                //         // actions.push('<a class="" href="javascript:void(0)" title="<@ctx.i18n text = "认领修改"/>" onclick="taskFromEdit(\'' + row.id + '\')">认领修改</a> ');
                //         actions.push('<a class="' + editFlag + '" href="javascript:void(0)" title="<@ctx.i18n text = "认领修改"/>" onclick="opt.operate.edit(\'' + row.id + '\')">认领修改</a> ');
                //         return actions.join('');
                // }}
            ]
        };
        $.table.init(options);
    });

    /* 挂起流程定义 */
    function disable(id) {
        opt.modal.confirm("确认要挂起流程定义吗？", function() {
            opt.operate.post(prefix + "/status", { "deploymentId": id, "status": 1 });
        })
    }

    /* 激活流程定义 */
    function enable(id) {
        opt.modal.confirm("确认要激活流程定义吗?", function() {
            opt.operate.post(prefix + "/status", { "deploymentId": id, "status": 0 });
        })
    }

    function taskFromEdit(id) {
        // opt.modal.confirm("确认要删除流程定义吗?", function() {
      //  opt.modal.openTab(prefix + "/edit", { "id": id});
        console.log("1111111111");
        console.log(id);
        console.log("11111111");
        opt.modal.openTab("认领修改",prefix + "/edit/"+id);
        // })
    }

    function taskFrom(id){
        opt.modal.openTab("关联表单",prefix + "/taskfrom/"+id);
    }

    /*预览*/
    function preview(id) {
        var options = {
            url: prefix + "/preview/" + id,
            title: '<i class="fa icon-picture"></i> <@ctx.i18n text = "流程图"/>',
            btn:['<i class="fa fa-close"></i> '+$.i18n.prop("取消")],
            width: $(top.window).width() - 300,
            height: $(top.window).height() - 400
        };
        opt.modal.openMainWin(options);
    }

    /*预览XML*/
    function  preXml(id){
        var options = {
            url: prefix + "/xml/" + id,
            title:'<i class="fa fa-file-code-o"></i> <@ctx.i18n text = "BPMN2.0流程文件"/>',
            btn:['<i class="fa fa-close"></i> '+$.i18n.prop("取消")],
        };
        opt.modal.openMainWin(options);
    }

    /*生成代码*/
    function xmlDownload(id,name) {
        opt.modal.confirm("确定要下载[" + name + "]流程文件吗?", function() {
            location.href = prefix + "/download/" + id;
            opt.modal.msg('执行成功,正在下载请稍后…');
        })
    }
</script>
</@footer>
</@pageTheme>